<%--
  Created by cofey on 16/11/20.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>AP设备运行情况</title>
</head>
<body>
<!-- 当前位置 -->
<div id="urHere">无线南山统一管理平台<b>></b><strong>AP设备运行情况列表</strong></div>
<div id="index" class="mainBox" style="height:auto!important;height:550px;min-height:550px;">.
    <div class="indexBox">
        <div class="boxTitle">移动AP设备上月运行情况</div>
        <ul>
            <table width="100%" border="0" cellspacing="0" cellpadding="7">
                <tr>
                    <td width="120">正常运行AP数量：</td>
                    <td><strong>${mob.normalCount}</strong></td>
                    <td width="120">故障AP数量：</td>
                    <td><strong>${mob.faultCount}</strong></td>
                </tr>
                <tr>
                    <td>上行总流量：</td>
                    <td><strong>${mob.upTraffic}</strong></td>
                    <td>下行总流量：</td>
                    <td><strong>${mob.downTraffic}</strong></td>
                </tr>
                <tr>
                    <td>接入人数：</td>
                    <td><strong>${mob.joinCount}</strong></td>
                    <td></td>
                    <td></td>
                </tr>
            </table>
        </ul>
    </div><div class="indexBox">
        <div class="boxTitle">电信AP设备上月运行情况</div>
        <ul>
            <table width="100%" border="0" cellspacing="0" cellpadding="7">
                <tr>
                    <td width="120">正常运行AP数量：</td>
                    <td><strong>${tel.normalCount}</strong></td>
                    <td width="120">故障AP数量：</td>
                    <td><strong>${tel.faultCount}</strong></td>
                </tr>
                <tr>
                    <td>上行总流量：</td>
                    <td><strong>${tel.upTraffic}</strong></td>
                    <td>下行总流量：</td>
                    <td><strong>${tel.downTraffic}</strong></td>
                </tr>
                <tr>
                    <td>接入人数：</td>
                    <td><strong>${tel.joinCount}</strong></td>
                    <td></td>
                    <td></td>
                </tr>
            </table>
        </ul>
    </div>
    <div class="indexBox">
        <div class="boxTitle">AP设备统计信息</div>
        <div class="filter">
            <table width="100%">
                <tr>
                    <td align="right" width="10%">AP索引:</td>
                    <td width="38%">
                        <input name="filter_ap_index" type="text" class="inpMain"/>
                        <input name="submit" class="btnGray" type="button" value="筛选" onclick="config.loadContent();"/>
                        <input name="submit" class="btnGray" type="button" value="导出" onclick="config.export();"/>
                    </td>
                </tr>
            </table>
        </div>
        <div id="list">
            <table width="100%" border="0" cellpadding="8" cellspacing="0" class="tableBasic">
                <thead>
                <tr>
                    <th width="5%" align="center">序号</th>
                    <th width="15%" align="center">AP索引</th>
                    <th width="10%" align="center">IP地址</th>
                    <th width="13%" align="center">MAC地址</th>
                    <th width="13%" align="center">热点名称</th>
                    <th width="10%" align="center">运行状态</th>
                    <th width="10%" align="center">接入设备数(月)</th>
                    <th width="10%" align="center">上行流量</th>
                    <th width="10%" align="center">下行流量</th>
                </tr>
                </thead>
                <tbody></tbody>
            </table>
            <form name="selectForm" action="${ctx}/ap/content" method="post">
                <div class="g-pagebar"></div>
                <input type="hidden" name="apIndex"/>
                <input type="hidden" name="joinBeginTime"/>
                <input type="hidden" name="joinEndTime"/>
                <input type="hidden" name="hotspotId" value="${hotspot.id}"/>
            </form>
        </div>
    </div>
</div>
<script type="text/javascript">
    var config = null;
    jQuery(function ($) {
        var $container = $('.mainBox');
        var $filter = $container.find('.filter');
        var $pagebar = $container.find('.g-pagebar');
        var $tbodyContent = $container.find('table.tableBasic tbody');
        var $selectForm = $container.find("form[name=selectForm]");
        config = {
            pagebar: $pagebar,
            faultRecoverUrl: '${ctx}/ap/fault/dialog',
            init: function () {
                config.loadContent();
            },
            export: function () {
                config.setQueryWhere();
                $selectForm.attr("action", "${ctx}/export/ap");
                $selectForm.submit();
            },
            loadContent: function () {
                config.setQueryWhere();

                $tbodyContent.empty();
                $pagebar.off();

                var optionsPost = {
                    success: function (data) {
                        $tbodyContent.html(data);
                    }
                };
                $selectForm.attr("action", "${ctx}/ap/content");
                $selectForm.ajaxSubmit(optionsPost);
            },
            setQueryWhere: function () {
                var apIndex = $filter.find("input[name=filter_ap_index]").val();
                $selectForm.find("input[name=apIndex]").val(apIndex);

                /*var joinBeginTime = $filter.find("input[name=filter_begin_time]").val();
                 var joinEndTime = $filter.find("input[name=filter_end_time]").val();

                 $selectForm.find("input[name=joinBeginTime]").val(joinBeginTime);
                 $selectForm.find("input[name=joinEndTime]").val(joinEndTime);*/
            },
            viewFaultRecover: function (apDeviceId) {
                layer.full(layer.open({
                    type: 2,
                    title: '查看故障/维修记录',
                    content: config.faultRecoverUrl + "?apDeviceId=" + apDeviceId
                }));
            }
        }

        config.init();
    });
</script>
</body>
</html>
